<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ES学习案例</title>
</head>

<body>
    <div class="container">
        <h2 class="page-head">点击变换颜色</h2>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <script>
        // let item = document.documentElement.getElementsByClassName("item");
        // for (var i = 0; i < item.length; i++) {
        //     item[i].onclick = function() {
        //         this.style.background = 'pink';
        //     }

        // }
        const zhao = {
            name: '赵本山',
            age: '不详',
            xiaoping: function() {
                console.log("演小品");
            }
        };
        let xp = zhao;
        xp();
    </script>
</body>

</html>